package utils;

import org.jdom.Element;

public class User{
	
	public static String USERNAME;
	public static String PASSWORD;
	public static String FIRSTNAME;
	public static String LASTNAME;
	public static String COUNTRY;
	public static String PROVINCE;
	public static String CITY;
	public static String CIVICADDRESS;
	public static String ZIPCODE;
	public static String PHONENUMBER;
	
	public User(String name, String pass){
		Element XMLFileRoot = Dom.getXMLFile("users.xml").getRootElement();
		Element user = XMLFileRoot.getChild(name);
		
		USERNAME = name;
		PASSWORD = pass;
		FIRSTNAME = user.getChildText("firstname");
		LASTNAME = user.getChildText("lastname");
		COUNTRY = user.getChildText("country");
		PROVINCE = user.getChildText("province");
		CITY = user.getChildText("city");
		CIVICADDRESS = user.getChildText("civicaddress");
		ZIPCODE = user.getChildText("zipcode");
		PHONENUMBER = user.getChildText("phonenumber");
	}	
}
 